Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@babel/plugin-syntax-logical-assignment-operators
Advanced tools
Allow parsing of the logical assignment operators
The @babel/plugin-syntax-logical-assignment-operators package allows Babel to parse code that uses logical assignment operators. These operators combine logical operations with assignment expressions. This plugin only enables the syntax, and does not transform it. To transform the code, you would need to use another plugin or set of plugins that handle the transformation.
Logical AND Assignment (&&=)
The logical AND assignment (&&=) operator only assigns the value of the right operand to the left operand if the left operand is truthy.
a &&= b;
Logical OR Assignment (||=)
The logical OR assignment (||=) operator assigns the value of the right operand to the left operand if the left operand is falsy.
a ||= b;
Logical Nullish Assignment (??=)
The logical nullish assignment (??=) operator assigns the value of the right operand to the left operand if the left operand is null or undefined.
a ??= b;
This package is a proposal plugin that not only allows Babel to parse logical assignment operators but also transforms them. It is similar to @babel/plugin-syntax-logical-assignment-operators but includes the transformation step.
While not exclusively focused on logical assignment operators, @babel/preset-env includes the necessary plugins to both parse and transform modern JavaScript syntax, including logical assignment operators, based on the target environment.
Allow parsing of the logical assignment operators
See our website @babel/plugin-syntax-logical-assignment-operators for more information.
Using npm:
npm install --save-dev @babel/plugin-syntax-logical-assignment-operators
or using yarn:
yarn add @babel/plugin-syntax-logical-assignment-operators --dev
FAQs
Allow parsing of the logical assignment operators
The npm package @babel/plugin-syntax-logical-assignment-operators receives a total of 21,132,955 weekly downloads. As such, @babel/plugin-syntax-logical-assignment-operators popularity was classified as popular.
We found that @babel/plugin-syntax-logical-assignment-operators demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.